Troubleshooting > InfoPath > InfoPath - Invalid date error in Data Event wizard | Send feedback |
When using a suggested "Format DateTime - Inline function" with a K2 Date field and the "yyyy-MM-dd" format as a parameters for a mapping source, and an InfoPath "Date" XML node as the destination, the mapping during runtime resolves the source value correctly for example,"2010-07-20" but casts the value to a DateTime object which then adds a TimeSpan to the already correct Date value resulting in "2010-07-20 12:00:00 AM". This is not expected in the InfoPath schema for the Node , which causes InfoPath to raise an error on opening stating that the "value is not a valid date".
The destination value type can be determined as the InfoPath schema for the node is available when the mapping is being authored, this will allow the Data Mapper to determine whether the source value should be used as a string or as a datetime object during runtime.